﻿using System;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI.Selection;

namespace WallCreateAndEdit.WallModule.EditWall
{
	public class WallFilter : ISelectionFilter
	{
		public bool AllowElement(Element elem)
		{
			if (elem.Category == null)
			{
				return false;
			}
			if (null == elem.Category.Id)
			{
				return false;
			}
			if (-2000011 == elem.Category.Id.IntegerValue)
			{
				Wall wall = elem as Wall;
				return wall.WallType.Kind == null;
			}
			return false;
		}

		public bool AllowReference(Reference reference, XYZ pos)
		{
			return false;
		}
	}
}
